import socket
import simplejson
import cv2
import numpy as np
info_cmd = {
        "opType":1,
        "setData":[],
        "waveLength":0
       }

start_cmd = {
        "opType":2,
        "setData":[{"type":0,"lcopa":"0x1234","u-phi":"DF2014-FA88.txt"}],
        "waveLength":1024
       }

stop_cmd = {
        "opType":3,
        "setData":[],
        "waveLength":1024
       }
setting_cmd = {
        "opType":4,
        "setData":[{"type":0,"lcopa":"0x1234","u-phi":"DF2014-FA88.txt"}],
        "waveLength":1024
       }
address = ('127.0.0.1', 8089)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(address)

cmd_json = simplejson.dumps(start_cmd)
s.send(cmd_json)

data = s.recv(1024)
print data
s.close()
